package com.liyuxiang.yygh.hosp.controller;

import com.liyuxiang.yygh.common.result.Result;
import com.liyuxiang.yygh.hosp.service.DepartmentService;
import com.liyuxiang.yygh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @GetMapping("/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable("hoscode") String hoscode) {

        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);

        return Result.ok(list);

    }
}
